//Cristian Moral Martos

package Ejercicio02;

import java.io.IOException;

import utils.ImagePGM;

/**
 * Exercise 2.2 Implement the following functions to compare two input images:
 * 
 * imIsGreater (imageIn1, imageIn2) // this function returns true if every pixel
 * in imageIn has an intensity value greater than or equal to its intensity
 * value in imageIn2, and it returns false otherwise
 * 
 * imIsGreaterStrict (imageIn1, imageIn2) //this function returns true if every
 * pixel in imageIn has an intensity value greater (strict) than its intensity
 * value in imageIn2, and it returns false otherwise
 * 
 * imIsLessThan (imageIn1, imageIn2) //this function returns true if every pixel
 * in imageIn has an intensity value smaller than or equal to its intensity
 * value in imageIn2, and it returns false otherwise
 * 
 * imIsLessThanStrict (imageIn1, imageIn2) // this function returns true if
 * every pixel in imageIn has an intensity value smaller (strict) than its
 * intensity value in imageIn2, and it returns false otherwise
 * 
 */
public class Ejercicio22 {

	public static void main(String[] args) throws IOException {
		// Recuperamos los paths de las imagenes a comparar
		String path1 = "input\\cam_74.pgm";
		ImagePGM image1 = new ImagePGM(path1);

		String path2 = "input\\cam_74.pgm";
		ImagePGM image2 = new ImagePGM(path2);

		System.out.println("Image " + path1 + " is "
				+ (image1.imageIsGreater(image2) ? "" : "not ")
				+ "greater or equal than image " + path2);
		System.out.println("Image " + path2 + " is "
				+ (image2.imageIsGreater(image1) ? "" : " not ")
				+ "greater or equal than image " + path1);
		System.out.println();
		System.out.println("Image " + path1 + " is "
				+ (image1.imageIsGreaterStrict(image2) ? "" : "not ")
				+ "greater than image " + path2);
		System.out.println("Image " + path2 + " is "
				+ (image2.imageIsGreaterStrict(image1) ? "" : "not ")
				+ "greater than image " + path1);
		System.out.println();
		System.out.println("Image " + path1 + " is "
				+ (image1.imageIsLessThan(image2) ? "" : "not ")
				+ "less or equal than image " + path2);
		System.out.println("Image " + path2 + " is "
				+ (image2.imageIsLessThan(image1) ? "" : "not ")
				+ "less or equal than image " + path1);
		System.out.println();
		System.out.println("Image " + path1 + " is "
				+ (image1.imageIsLessThanStrict(image2) ? "" : "not ")
				+ "less than image " + path2);
		System.out.println("Image " + path2 + " is "
				+ (image2.imageIsLessThanStrict(image1) ? "" : "not ")
				+ "less than image " + path1);

	}
}
